import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
import Index from '../views/Index'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'login',
        component: Login
    },
    {
        path: '/index',
        name: 'index',
        component: Index,
        children: [
            {
                path: "RecordManage",
                name: "打卡记录",
                component: () => import('../views/RecordManage.vue')
            },
            {
                path: "AddRecord",
                name: "健康打卡申报",
                component: () => import('../views/AddRecord.vue')
            },
            {
                path: "IdenManage",
                name: "疑似/确诊人员登记",
                component: () => import(/* webpackChunkName: "BlogManage" */ '../views/IdenManage.vue')
                //const Foo = () => import(/* webpackChunkName: "group-foo" */ './Foo.vue')
            },
            {
                path: "IsManage",
                name: "隔离人员登记",
                component: () => import(/* webpackChunkName:"AddBlog" */ '../views/IsManage.vue')
            },
            {
                path: "MaterialManage",
                name: "防疫物资查看",
                component: () => import(/* webpackChunkName:"MaterialManage" */ '../views/MaterialManage.vue')
            }, {
                path: "AddMaterial",
                name: "新增防疫物资",
                component: () => import(/* webpackChunkName:"AddMaterial" */ '../views/AddMaterial.vue')
            },
            {
                path: "EChart",
                name: "防疫数据可视化",
                component: () => import(/* webpackChunkName:"MaterialManage" */ '../views/EChart.vue')
            }
        ]
    },
    {
        path: '*',
        name: 'login',
        component: Login
    },
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
